﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ITAP.ShprossesBuilder.Properties;
using ITAP.ShprossesBuilder.Modelling.Components;
using ITAP.ShprossesBuilder.Modelling.Components.Constraints;

namespace ITAP.ShprossesBuilder.Operations
{
    public class OperationEnableDisableUniqueIdsConnections : IOperation
    {
        #region IOperation Members

        public string Name
        {
            get { return "Включить/выключить соединения по ID"; }
        }

        public OperationGroup OperationGroup
        {
            get { return OperationGroup.Other; }
        }

        public System.Drawing.Image Thumbnail
        {
            get { return Resources.EnableDisableTolerance.ToBitmap(); }
        }

        public void Execute(ModelControl modelControl)
        {
            foreach (IComponent innerComponent in modelControl.ModelContainer.AllInnerComponents)
            {
                innerComponent.UniqueIdsEnabled = !innerComponent.UniqueIdsEnabled;
            }
        }

        public bool CanUndo
        {
            get { return false; }
        }

        #endregion
    }
}
